import { mergeRsbuildConfig } from "@rsbuild/core";
import path from "node:path";
import pluginSwagger from "./plugins/swagger";
import rsbuildConfigBase from "./rsbuild.config.base";

export default mergeRsbuildConfig(
	{
		mode: "development",
		server: {
			port: 4300,
			proxy: {
				"/api": {
					target: "https://tadmin-health.aspiredt.com",
					changeOrigin: true,
				},
			},
		},
		plugins: [
			pluginSwagger({
				output: path.resolve("./src/api"),
				url: "https://tadmin-health.aspiredt.com/swagger/v1/swagger.json",
				httpClientType: "fetch",
				extractResponseBody: true,
				modular: true,
				unwrapResponseData: true,
			}),
		],
	},
	rsbuildConfigBase,
);
